package com.yx.outSourcing.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

public enum PersonStatus {
    FAILURE(0, "失效"),
    NORMAL(1, "正常");

    @EnumValue  // 标记存储到数据库的值
    private final int value;

    @JsonValue  // 标记JSON序列化的值
    private final String desc;

    PersonStatus(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    // 可选：通过value获取枚举实例
    public static AppStatus fromValue(int value) {
        for (AppStatus status : AppStatus.values()) {
            if (status.getValue() == value) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的状态值: " + value);
    }
}
